using System;
using UnityEngine;

namespace M13.Game.Item
{
    public interface IItem
    {
        public OperateKey GetOperateKey();
        public void OnBootyDrop();
        public ItemProperties GetItemProperties();
    }
    public enum ItemType
    {
        Item,
        Weapon,
        Food,
    }
    [Serializable]
    public class Item : IItem
    {
        public ItemProperties ItemProperties { get; protected set; }

        protected virtual void Init(ItemProperties itemProperties)
        {
            ItemProperties = itemProperties;
        }

        public virtual OperateKey GetOperateKey()
        {
            return OperateKey.L;
        }

        public virtual void OnBootyDrop()
        {

        }

        

        public ItemProperties GetItemProperties()
        {
            return ItemProperties;
        }

        
    }
    public struct ItemProperties
    {
        public int Id { get; private set; }
        public string NamespaceId { get; private set; }
        public ItemType ItemType { get; private set; }
        public int MaxStackCount { get; private set; }
        public Sprite ItemIcon { get; private set; }

        public GameObject ItemModal { get; private set; }


        public ItemProperties(int id, string namespaceId, ItemType itemType, int maxStackCount, Sprite itemIcon, GameObject itemModal)
        {
            Id = id;
            ItemType = itemType;
            MaxStackCount = maxStackCount;
            NamespaceId = namespaceId;
            ItemIcon = itemIcon;
            ItemModal = itemModal;
        }
    }
}